import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
//配置elementui
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
Vue.use(ElementUI);
//配置 全局初始化样式
import "@/assets/css/reset.scss";
Vue.config.productionTip = false;
//全局前置钩子(路由守卫)
router.beforeEach((to, from, next) => {
  //to 即将进入的路由
  //from 即将离开的路由
  //next放行
  //判断本地是否有token
  //除了登入页以外,其他所有页面都不给用户访问
  //如有就放行,如没有就不通过重新跳转登入页
  let token = localStorage.getItem("qf-token") || "";
});
new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");
